What will be the output of the following Python code? def foo(i, x=[]): x.append(x.append(i)) return x for i in range(3): y = foo(i) print(y)
1.[[[0]], [[[0]], [1]], [[[0]], [[[0]], [1]], [2]]]
2.[[0], [[0], 1], [[0], [[0], 1], 2]]
3.[0, None, 1, None, 2, None]
4.[[[0]], [[[0]], [1]], [[[0]], [[[0]], [1]], [2]]]
Posted Date:-2022-01-01 18:56:34